package cn.tedu.stock.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface StockMapper {
    //自定义一个扩展的方法
    @Update("update stock_tbl set stock=stock-#{count} where " +
            "product_code=#{productCode} and stock>#{count}")
    Integer reduceStock(String productCode, Integer count);
}
